/*
* @Author: wangke
* @Date:   2016-06-12 10:31:37
* @Last Modified by:   wangke
* @Last Modified time: 2016-06-12 11:14:07
*/

#include <iostream>

#include "funa.h"

using namespace std; 

int funa(int val[], int num)
{
	int maxVal, minVal;
	int maxIndex, minIndex;

	maxVal = val[0];
	minVal = val[0];	
	maxIndex = 0;
	minIndex = 0;

	for(int nr = 0; nr < num; nr++) {
		if(maxVal<val[nr]) {
			maxVal = val[nr];
			maxIndex = nr; 

			
		}

		if(minVal>val[nr]) {
			minVal = val[nr];
			minIndex = nr;

		}
	}

	val[maxIndex] = 0;
	val[minIndex] = 0;

	return  funcb(val, num);
}

